<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>柱状图</title>
    <script src="/js/jquery-1.11.3.min.js"></script>
    <script src="/js/echarts.common.min.js"></script>
    <script>
        $(function(){
            var myChart = echarts.init($("#main")[0]);
            var option = {
                title : {
                    text: '同名数量统计',
                    subtext: '纯属虚构',
                    x:'center'
                },
                tooltip : {
                    trigger: 'item',
                    formatter: "{a} <br/>{b} : {c} ({d}%)"
                },
                legend: {
                    type: 'scroll',
                    orient: 'vertical',
                    right: 10,
                    top: 20,
                    bottom: 20,
                    data: [
                        "张三","李四","王五","老六","小七","王八","雷九"
                    ],
                    selected: {

                    }
                },
                series : [
                    {
                        name: '姓名',
                        type: 'pie',
                        radius : '55%',
                        center: ['40%', '50%'],
                        data: [
                            {"name":"张三","value":123},
                            {"name":"李四","value":146},
                            {"name":"王五","value":37},
                            {"name":"老六","value":1782},
                            {"name":"小七","value":1289},
                            {"name":"王八","value":4579},
                            {"name":"雷九","value":238}
                        ],
                        itemStyle: {
                            emphasis: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };
            myChart.setOption(option);
        });
    </script>
</head>
<body>
    <div id="main" style="width: 600px;height:400px;"></div>
</body>
</html>